/**
 * NumNode.java 1.0 2007-6-21 下午09:27:26,创建 by yangfan
 */


package org.in4j.compiler.sandbox.calcuator;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.in4j.compiler.sandbox.calcuator.Context;
import org.in4j.compiler.sandbox.calcuator.Node;

/**
 * <NUM> ::= <number>
 * @author yangfan
 * @version 1.0 2007-6-21 下午09:27:26,创建
 */
public class NumNode implements Node
{
	@SuppressWarnings("unused")
	private static final Log log = LogFactory.getLog(NumNode.class);
	private int num;

	public void execute()
	{
	}

	public void parse(Context context)
	{
		context.nextToken();
		num = context.currentNumber();
	}

	public int getValue()
	{
		return num;
	}

	@Override
	public String toString()
	{
		return "<NUM," + this.getValue() + ">";
	}
}
